home *** CD-ROM | disk | FTP | other *** search
- Path: mudskipper.cac.psu.edu!user
- From: fcusack@tdx.org (frank.)
- Newsgroups: comp.lang.c
- Subject: Re: (VOID *) Problems
- Date: Thu, 15 Feb 1996 14:43:02 -0400
- Organization: Psychic Enemies Network
- Distribution: world
- Message-ID: <fcusack-1502961443020001@mudskipper.cac.psu.edu>
- References: <3120F9B8.167E@pangea.stanford.edu> <fcusack-1302961720420001@mudskipper.cac.psu.edu> <4ft16a$1v1@sparcserver.lrz-muenchen.de>
- NNTP-Posting-Host: mudskipper.cac.psu.edu
-
- In article <4ft16a$1v1@sparcserver.lrz-muenchen.de>,
- ua302aa@lrz-muenchen.de () wrote:
-
- > fcusack@tdx.org (frank.) writes:
- > >In article <3120F9B8.167E@pangea.stanford.edu>, BITtencourt
- > ><bit@pangea.stanford.edu> wrote:
- >
- > >> double x,z;
- > > ^^^^^^^^^^
- >
- > >z is declared as type double.
- >
- > >>
- > >> x = 78.;
- > >> printf("x = %f \n",x);
- > >> p = (void *) &x;
- > >> printf("*p = %f \n",(double *) p);
- > >> z = (double *)p; /* problems. I also tried other
- > >> cast forms. */
- > > ^^^^^^^^^^^
- >
- > >here you try to assign a double * to z, which does not match z's type.
- >
- > >Try z = &p; /* or z = &(double *) p; /* but the cast is not really needed */
- >
- > If z is a pointer to double, a pointer to a pointer to double won't
- > match it's type more closely than a pointer to double, will it?
- >
-
- quite right. I used "&" instead of "*". Ugh. Lots of ppl caught my error
- though, it seems, based on the email I received. :)
- ~Frank
- -- I am Pentium of Borg. Division is futile. You will be approximated. --
- -- If you build it, they will come --> http://www.tdx.org/~fcusack/ --
- -- PGP key fingerprint: 01 C0 C0 B9 CC 78 67 0F 3F 64 80 65 8B 0F F9 EA --
-